//
//  CatchDataService.m
//  investevent
//
//  Created by jiangshao on 16/3/8.
//  Copyright © 2016年 com.scj.investevent. All rights reserved.
//

#import "CatchDataService.h"

@implementation CatchDataService

+(NSString*) getStringByUrl:(NSString*)strurl{
    NSURL *url = [NSURL URLWithString:strurl];
    NSData *data =[NSData dataWithContentsOfURL:url];
    NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
    NSString *retStr = [[NSString alloc] initWithData:data encoding:enc];
    return retStr;
}


+(NSDictionary *) getJsonDataByUrl:(NSString*)strurl{
    
//    AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
//    [session GET:strurl parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
//        NSArray *array=[responseObject objectForKey:@"data"];
//    } failure:^(NSURLSessionDataTask *task, NSError *error) {
//        NSLog(@"失败");
//    }];
 
    
//    NSError *error;
//    NSURL *url = [NSURL URLWithString:strurl];
//    NSData *data =[NSData dataWithContentsOfURL:url];
////    data=[self replaceNoUtf8:data];
//    //IOS5自带解析类NSJSONSerialization从response中解析出数据放到字典中
//    NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data
//                                                        options:NSJSONReadingMutableContainers
//                                                          error:&error];
//    NSDictionary *resultJSON = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
    return nil;
}



//NSDictionary *weatherDic = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableLeaves error:&error];




@end
